// 导入了一个用于处理cookies的库
import Cookies from 'js-cookie'

// 本地保存token的键值
const TokenKey = 'HMHR72'

// 获取token
export function getToken () {
  return Cookies.get(TokenKey)
}
// 修改token
export function setToken (token) {
  return Cookies.set(TokenKey, token)
}
// 删除token
export function removeToken () {
  return Cookies.remove(TokenKey)
}
// 保存时间戳的key
const timeKey = 'HMHR72-timestamp'
// 获取时间戳
export function getTimeStamp () {
  return Cookies.get(timeKey)
}
// 设置时间戳
export function setTimeStamp () {
  Cookies.set(timeKey, Date.now())
}
// 删除时间戳
export function removeTimeStamp () {
  return Cookies.remove(timeKey)
}
